package com.pwser.dubbo.provider.impl;

import java.util.ArrayList;
import java.util.List;

import com.pwser.bean.User;
import com.pwser.dubbo.provider.DemoService;

public class DemoServiceImplA implements DemoService {
	
	private static int callNum = 1;

	@Override
	public String sayHello(String name) {
		System.out.println("providerA 'sayHello' method is called "+ (callNum++) +" !!!---------" + "Hello " + name);
		return "providerA Hello " + name;
	}

	@Override
	public List<User> getUserList() {
		System.out.println("providerA 'getUserList' method is called!!!");
		User u1 = new User();
		u1.setUserId(1);
		u1.setUserName("Tom");
		u1.setPassWord("123");
		u1.setAge(20);
		
		User u2 = new User();
		u2.setUserId(2);
		u2.setUserName("Jeck");
		u2.setPassWord("123");
		u2.setAge(23);
		
		User u3 = new User();
		u3.setUserId(3);
		u3.setUserName("Marry");
		u3.setPassWord("123");
		u3.setAge(21);
		
		ArrayList<User> userList = new ArrayList<User>();
		userList.add(u1);
		userList.add(u2);
		userList.add(u3);
		
		return userList;
	}

}
